package com.anxin.act.config.service;

import java.util.List;
import com.anxin.framework.web.service.BaseService;
import com.anxin.common.utils.SecurityUtils;
import com.anxin.sys.system.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.anxin.act.config.dao.WfApplyFormFieldDao;
import com.anxin.act.config.entity.WfApplyFormField;

/**
 * 流程申请单字段Service业务层处理
 *
 * @author jbs
 * @date 2020-03-13
 */
@Service
public class WfApplyFormFieldService extends BaseService<WfApplyFormFieldDao,WfApplyFormField>{
    @Autowired
    private WfApplyFormFieldDao wfApplyFormFieldDao;

    /**
     * 查询流程申请单字段
     *
     * @param id 流程申请单字段ID
     * @return 流程申请单字段
     */
    public WfApplyFormField getById(Long id){
        return wfApplyFormFieldDao.getById(id);
    }

    /**
     * 查询流程申请单字段列表
     *
     * @param wfApplyFormField 流程申请单字段
     * @return 流程申请单字段
     */
    public List<WfApplyFormField> findList(WfApplyFormField wfApplyFormField){
        return wfApplyFormFieldDao.findList(wfApplyFormField);
    }



    /**
     * 保存流程申请单字段
     *
     * @param wfApplyFormField 流程申请单字段
     * @return 结果
     */
    public int update(WfApplyFormField wfApplyFormField){
        return super.save(wfApplyFormField);
    }


    /**
     * 删除流程申请单字段信息
     *
     * @param id 流程申请单字段ID
     * @return 结果
     */
    public int deleteById(Long id){
        SysUser user = SecurityUtils.getUser();
        return wfApplyFormFieldDao.deleteById(id,user.getId());
    }
}
